<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>复合选择器-子代选择器</title>
    <style>
        div>span {
            color: red;
        }
    </style>
</head>

<body>
  <div>
    <span>儿子 span</span>
  </div>
  <p>
    <span>孙子 span</span>
  </p>
</body>

</html>